// mixins for grid system
// ------------------------

.loop-grid-columns(@index, @class) when (@index > 0) {
    .u-col@{class}-@{index} {
        display: block;
        flex: 0 0 percentage((@index / @grid-columns));
        max-width: percentage((@index / @grid-columns));
    }

    .loop-grid-columns((@index - 1), @class);
}

.loop-grid-columns(@index, @class) when (@index =0) {
    .u-col@{class}-@{index} {
        display: none;
    }
}

.make-grid(@class: ~'') {
    .loop-grid-columns(@grid-columns, @class);
}